package se.olli.mewiki;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

public class CharacterActivity extends Activity {
	
	private int[] charImages = {R.drawable.shepard, R.drawable.liara, R.drawable.joker,
			R.drawable.maintali, R.drawable.garrus, R.drawable.wrex};
	private String[] charDescriptions, charHeadlines;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.character);
		
		Intent charIntent = getIntent();
		int charId = charIntent.getIntExtra(AndroidDesignActivity.CHARACTER, 0);
		
		charDescriptions = getResources().getStringArray(R.array.char_descriptions);
		charHeadlines = getResources().getStringArray(R.array.char_headlines);
		
		//ImageView image = (ImageView) findViewById(R.id.char_img);
		LinearLayout layout = (LinearLayout) findViewById(R.id.char_layout);
		TextView desc = (TextView) findViewById(R.id.char_desc);
		TextView head = (TextView) findViewById(R.id.char_head);

		//image.setImageResource(charImages[charId]);
		layout.setBackgroundResource(charImages[charId]);
		desc.setText(charDescriptions[charId]);
		head.setText(charHeadlines[charId]);
	}
}
